<template>
  <div class="con">
    <el-container>
      <el-container>
        <el-main style="padding: 0">
          <!-- 放置内容区 -->
          <div class="contbox6_10" v-if="true">
            <p class="titlelist6_10">
              账户管理
              <span style="color: #999">&nbsp;&nbsp;/&nbsp;&nbsp;</span>提现明细
            </p>
            <div class="content">
              <div class="sousuojg6_10">
                <el-tabs
                  v-model="activeName"
                  class="tabBox"
                  @tab-click="handleClick"
                >
                  <el-tab-pane
                    label="全部提现"
                    name="1"
                    v-if="loginName == 2"
                  ></el-tab-pane>
                  <el-tab-pane
                    label="我的提现"
                    name="2"
                    v-if="loginName != 2"
                  ></el-tab-pane>
                  <el-tab-pane
                    label="代理提现"
                    name="3"
                    v-if="loginName != 2"
                  ></el-tab-pane>
                </el-tabs>
                <div style="height: 40px"></div>
                <el-form ref="listQuery" :model="listQuery" label-width="150px">
                  <!-- <el-form-item label="归属机构">
                    <el-input
                      readonly
                      placeholder="请输入归属机构"
                      @focus="selectInstitution"
                      v-model="officeName"
                    ></el-input>
                  </el-form-item> -->
                  <el-form-item label="机构ID">
                    <el-input
                      placeholder="请输入机构ID"
                      v-model="listQuery.officeUid"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="机构名称">
                    <el-input
                      placeholder="请输入机构名称"
                      v-model="listQuery.officeName"
                    ></el-input>
                  </el-form-item>
                  <el-form-item v-if="sign" label="机构类型">
                    <el-select
                      v-model="listQuery.officeType"
                      placeholder="请选择机构类型"
                      class="filter-item"
                    >
                      <el-option
                        v-for="item in officeType"
                        :key="item.id"
                        :label="item.label"
                        :value="item.id"
                      ></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="提现订单号">
                    <el-input
                      placeholder="请输入提现订单号"
                      v-model="listQuery.orderCode"
                    ></el-input>
                  </el-form-item>
                  <!-- <el-col :span="6">
                      <el-form-item label="归属机构">
                        <el-input placeholder="请输入归属机构" v-model="listQuery.oemName"></el-input>
                      </el-form-item>
                  </el-col>-->
                  <el-form-item label="通道订单号">
                    <el-input
                      placeholder="请输入通道订单号"
                      v-model="listQuery.channelOrderCode"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="提现方式">
                    <el-select
                      v-model="listQuery.withdrawType"
                      clearable
                      placeholder="请选择"
                    >
                      <el-option label="全部" value=""></el-option>
                      <el-option label="线下提现" value="0"></el-option>
                      <el-option label="海科代付" value="1"></el-option>
                      <el-option label="厦门国际分账" value="2"></el-option>
                      <el-option label="支付宝" value="3"></el-option>
                      <el-option label="微信" value="3"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="有无发票">
                    <el-select
                      v-model="listQuery.billFlag"
                      clearable
                      placeholder="请选择"
                    >
                      <el-option label="全部" value=""></el-option>
                      <el-option label="无票" value="0"></el-option>
                      <el-option label="有票" value="1"></el-option>
                    </el-select>
                  </el-form-item>
                  <el-form-item label="账户名称">
                    <el-input
                      placeholder="请输入账户名称"
                      v-model="listQuery.accountName"
                    ></el-input>
                  </el-form-item>
                  <!-- <el-col class="line" :span="6" v-if="sign">
                      <el-form-item label="提现账户类型">
                        <el-select style="width:100%" clearable  v-model="listQuery.withdrawAccountType" placeholder="请选择提现账户类型"
                                   class="filter-item">
                          <el-option
                            v-for="item in withdrawType"
                            :key="item.id"
                            :label="item.label"
                            :value="item.id"
                          ></el-option>
                        </el-select>
                      </el-form-item>
                  </el-col>-->
                  <el-form-item label="提现账号">
                    <el-input
                      placeholder="请输入提现账号"
                      v-model="listQuery.accountNo"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="审核状态">
                    <el-select
                      v-model="listQuery.checkStat"
                      clearable
                      placeholder="请选择"
                    >
                      <el-option label="全部" value=""></el-option>
                      <el-option label="待审核" value="0"></el-option>
                      <el-option label="审核成功" value="1"></el-option>
                      <el-option label="审核拒绝" value="2"></el-option>
                      <!-- <el-option label="提现失败" value="3"></el-option> -->
                    </el-select>
                  </el-form-item>

                  <el-form-item label="出款状态">
                    <el-select
                      v-model="listQuery.payStatus"
                      clearable
                      placeholder="请选择"
                    >
                      <el-option label="全部" value=""></el-option>
                      <el-option label="未出款" value="0"></el-option>
                      <el-option label="出款中" value="1"></el-option>
                      <el-option label="出款成功" value="2"></el-option>
                      <el-option label="出款失败" value="3"></el-option>
                      <!-- <el-option label="出款异常" value="4"></el-option> -->
                    </el-select>
                  </el-form-item>
                  <el-form-item label="申请时间">
                    <el-date-picker
                      type="date"
                      value-format="yyyy-MM-dd"
                      placeholder="开始日期"
                      v-model="listQuery.startDate"
                    ></el-date-picker>
                    <div class="times">-</div>
                    <el-date-picker
                      type="date"
                      value-format="yyyy-MM-dd"
                      placeholder="结束日期"
                      v-model="listQuery.endDate"
                    ></el-date-picker>
                  </el-form-item>
                  <el-form-item label="审核时间">
                    <!-- <el-col :span="11"> -->
                    <el-date-picker
                      type="date"
                      value-format="yyyy-MM-dd"
                      placeholder="开始日期"
                      v-model="listQuery.auditStartDate"
                    ></el-date-picker>
                    <div class="times">-</div>
                    <el-date-picker
                      type="date"
                      value-format="yyyy-MM-dd"
                      placeholder="结束日期"
                      v-model="listQuery.auditEndDate"
                    ></el-date-picker>
                  </el-form-item>

                  <!-- <el-form-item
                  class="line"
                  :span="20"
                  style="display:flex;margin-left:20px"
                > -->

                  <!-- </el-form-item> -->
                </el-form>
              </div>
              <div class="buttons">
                <el-button
                  v-if="isAuth('withdrawSearch')"
                  type="primary"
                  @click="handleSelectLists"
                  >搜索</el-button
                >
                <el-button
                  v-if="isAuth('withdrawReset')"
                  @click="resetTheSearch"
                  >重置</el-button
                >
                <el-button
                  @click="shen"
                  class="butt"
                  type="primary"
                  style="margin-left: 40px"
                  v-if="total > 0"
                >
                  批量审核
                </el-button>
                <el-button
                  @click="exportFiles"
                  class="butt"
                  type="primary"
                  v-if="total > 0"
                >
                  批量导出
                </el-button>
              </div>
              <div style="margin-top: 10px">
                <!-- <div
                  class="line"
                  style="display: flex; float: left; margin-left: 20px"
                >
                  <span>累计提现金额：{{ monthWithdraw }}元</span>
                  <span>今日提现：{{ nowDayWithdraw }}元</span>
                </div> -->
                <el-table
                  :data="list"
                  ref="multipleTable"
                  :header-cell-style="{ background: '#F9FAFC', color: '#222' }"
                  stripe
                  border
                  :row-style="{ height: '0px' }"
                  :cell-style="{ padding: '0px' }"
                  @selection-change="handleSelectionChange"
                  style="margin-top: 24px !important"
                >
                  <el-table-column
                    type="selection"
                    width="50"
                  ></el-table-column>
<<<<<<< HEAD
                  
=======
                  <el-table-column :span="6" label="机构类型">
                    <template slot-scope="scope">
                      <span>{{
                        (scope.row.officeType == 1 && "普通代理") ||
                        (scope.row.officeType == 0 && "OEM") ||
                        (scope.row.officeType == 2 && "admin") ||
                        (scope.row.officeType == 3 && "渠道机构")
                      }}</span>
                    </template>
                  </el-table-column>
>>>>>>> 92876572c12697e8207b60a1c090b9741b12e1d1
                  <el-table-column
                    show-overflow-tooltip
                    min-width="180"
                    label="机构ID"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.officeUid }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="200"
                    label="机构名称"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.officeName }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column :span="6" label="机构类型">
                    <template slot-scope="scope">
                      <span>{{
                        (scope.row.officeType == 1 && "普通代理") ||
                        (scope.row.officeType == 0 && "OEM") ||
                        (scope.row.officeType == 2 && "admin")||
                        (scope.row.officeType == 3 && "渠道机构")
                      }}</span>
                    </template>
                  </el-table-column>
                  <!-- <el-table-column :span="6" label="归属机构">
                    <template slot-scope="scope">
                      <span>{{scope.row.oemName}}</span>
                    </template>
                </el-table-column>-->
                  <!-- <el-table-column :span="6" label="账户余额">
                  <template slot-scope="scope">
                    <span>{{ scope.row.availAmt }}</span>
                  </template>
                </el-table-column> -->
                  <el-table-column
                    show-overflow-tooltip
                    min-width="200"
                    label="提现订单号"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.orderCode }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="150"
                    label="通道订单号"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.channelOrderCode }}</span>
                    </template>
                  </el-table-column>

                  <el-table-column
                    show-overflow-tooltip
                    min-width="130"
                    label="申请提现金额(元)"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.drawAmount }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="140"
                    label="提现手续费（元）"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.feeAmt }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="150"
                    label="实际到账金额（元）"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.arriveAmount }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="120"
                    label="提现方式"
                  >
                    <template slot-scope="scope">
                      <span v-if="scope.row.withdrawType == 0">线下提现</span>
                      <span v-if="scope.row.withdrawType == 1">海科代付</span>
                      <span v-if="scope.row.withdrawType == 2"
                        >厦门国际分账</span
                      >
                      <span v-if="scope.row.withdrawType == 3">支付宝</span>
                      <span v-if="scope.row.withdrawType == 4">微信</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="120"
                    label="有无发票"
                  >
                    <template slot-scope="scope">
                      <span v-if="scope.row.billFlag == 0">无</span>
                      <span v-if="scope.row.billFlag == 1">有</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    min-width="120"
                    label="账户名称"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.accountName }}</span>
                    </template>
                  </el-table-column>

                  <el-table-column
                    show-overflow-tooltip
                    min-width="120"
                    label="提现账号"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.accountNo }}</span>
                    </template>
                  </el-table-column>

                  <el-table-column
                    :span="6"
                    show-overflow-tooltip
                    min-width="160"
                    label="申请时间"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.createDate }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="160"
                    label="更新时间"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.updateDate }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="160"
                    label="审核状态"
                  >
                    <template slot-scope="scope">
                      <!-- <span>{{ scope.row.checkStat }}</span> -->
                      <span v-if="scope.row.checkStat == 0">待审核</span>
                      <span v-if="scope.row.checkStat == 1">审核成功</span>
                      <span v-if="scope.row.checkStat == 2">审核拒绝</span>
                      <!-- <span v-if="scope.row.checkStat == 3">提现失败</span> -->
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="160"
                    label="审核意见"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.checkMemo }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="160"
                    label="出款状态"
                  >
                    <template slot-scope="scope">
                      <span v-if="scope.row.payStatus == 0">未出款</span>
                      <span v-if="scope.row.payStatus == 1">出款中</span>
                      <span v-if="scope.row.payStatus == 2">出款成功</span>
                      <span v-if="scope.row.payStatus == 3">出款失败</span>
                      <span v-if="scope.row.payStatus == 4">出款异常</span>
                    </template>
                  </el-table-column>

                  <el-table-column
                    show-overflow-tooltip
                    :span="6"
                    min-width="160"
                    label="出款备注"
                  >
                    <template slot-scope="scope">
                      <span>{{ scope.row.payRemarks }}</span>
                    </template>
                  </el-table-column>
                  <el-table-column :span="6" label="操作" v-if="loginName == 2">
                    <template slot-scope="scope">
                      <!-- <el-button
                        v-if="
                          sign &&
                          isAuth('advanceDetails') &&
                          scope.row.officeType == 0
                            ? true
                            : !sign && scope.row.officeType == 1
                            ? true
                            : false
                        "
                        @click="examineData(scope.row)"
                        type="text"
                        icon="edit"
                        >查看</el-button
                      > -->
                      <el-button type="text" @click="examine(scope.row)">
                        审核
                      </el-button>
                    </template>
                  </el-table-column>
                </el-table>
                <div style="font-size: 16px; margin-top: 30px">
                  <div v-show="!listLoading" class="pagination-container">
                    <el-pagination
                      background
                      @size-change="handleSizeChange"
                      @current-change="handleCurrentChange"
                      :current-page.sync="listQuery.page"
                      :page-sizes="[20, 50, 100]"
                      :page-size="listQuery.number"
                      layout="total, sizes, prev, pager, next, jumper"
                      :total="total"
                    ></el-pagination>
                  </div>
                </div>
              </div>
            </div>
            <el-dialog
              :close-on-click-modal="false"
              title="提示"
              width="600px"
              :visible.sync="dialogFormWithdrawList"
            >
              <el-form
                :model="form"
                :rules="rules"
                ref="form"
                label-width="100px"
              >
                <div style="text-align: justify">
                  <div style="margin: 10px 10px 10px 10px">
                    <el-row>
                      <el-Col :span="24">
                        <el-alert
                          :title="title"
                          type="warning"
                          show-icon
                        ></el-alert>
                      </el-Col>
                      <el-Col
                        :span="24"
                        v-if="sign"
                        :style="sign ? 'margin-top: 15px' : ''"
                      >
                        <el-form-item label="提现账户：">{{
                          form.cardType == 1 ? "对公银行卡" : "对私银行卡"
                        }}</el-form-item>
                      </el-Col>
                      <el-Col
                        :span="24"
                        :style="!sign ? 'margin-top: 15px' : ''"
                      >
                        <el-form-item
                          label="账户名："
                          v-if="form.withdrawAccountType == 0"
                          >{{ form.officeName }}</el-form-item
                        >

                        <el-form-item label="结算账户名：" v-else>{{
                          form.officeName
                        }}</el-form-item>
                      </el-Col>
                      <el-Col :span="24">
                        <el-form-item
                          label="支付宝账号："
                          v-if="form.withdrawAccountType == 0"
                          >{{ form.withdrawAccountNo }}</el-form-item
                        >
                        <el-form-item label="结算账号：" v-else>{{
                          form.withdrawAccountNo
                        }}</el-form-item>
                      </el-Col>
                      <el-Col :span="24" v-if="form.withdrawAccountType != 0">
                        <el-form-item label="开户行：">{{
                          form.bankName
                        }}</el-form-item>
                      </el-Col>
                      <el-Col :span="24" v-if="sign">
                        <el-form-item label="开户支行：">{{
                          form.openBank
                        }}</el-form-item>
                      </el-Col>
                    </el-row>
                  </div>
                  <div style="width: 1px; background: rgb(231, 233, 238)"></div>
                  <div style="margin: 10px 10px 10px 10px">
                    <el-row>
                      <el-Col :span="24">
                        <el-alert
                          title="审核"
                          type="warning"
                          show-icon
                        ></el-alert>
                      </el-Col>
                      <el-Col
                        :span="24"
                        style="margin-top: 25px; margin-left: 14px"
                      >
                        <el-radio-group
                          v-model="form.operateStatus"
                          :disabled="form.statusCk != 0"
                        >
                          <el-radio :label="'1'"> 审核通过</el-radio>
                          <el-radio :label="'2'"> 审核未通过</el-radio>
                          <!-- <el-radio :label="'3'">订单成功</el-radio>
                          <el-radio :label="'4'">订单失败</el-radio> -->
                        </el-radio-group>
                      </el-Col>
                      <!--<el-Col :span="24"  :style="!sign?'margin-top: 35px':''" v-if="!sign">-->
                      <!--<el-form-item label="账户余额：" >-->
                      <!--{{form.availAmt}}-->
                      <!--</el-form-item>-->
                      <!--</el-Col>-->
                      <el-Col
                        :span="24"
                        :style="sign ? 'margin-top: 35px' : ''"
                      >
                        <el-form-item label="本次提现：">{{
                          form.drawAmount
                        }}</el-form-item>
                      </el-Col>
                      <el-Col :span="24">
                        <el-form-item label="手续费：">{{
                          form.drawFee
                        }}</el-form-item>
                      </el-Col>
                      <el-Col :span="24">
                        <el-form-item
                          :label="sign ? '实际付款金额：' : '实际到账：'"
                          >{{ form.arriveAmount }}</el-form-item
                        >
                      </el-Col>
                      <el-Col :span="24" style="margin-top: 35px" v-if="sign">
                        <el-input
                          type="textarea"
                          placeholder="请输入不少于五个字的审核意见"
                          v-model="form.remarke"
                        ></el-input>
                      </el-Col>
                    </el-row>
                  </div>
                </div>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormWithdrawList = false"
                  >取 消</el-button
                >
                <el-button type="primary" @click="upData('form')"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </div>
        </el-main>
      </el-container>
    </el-container>
    <Tree :showType="showType" @func="transmit" />
    <!-- 审核弹框 -->
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="700px"
      :before-close="handleClose"
    >
      <div>
        <div v-if="type == ''">
          <div class="lister">
            <div class="listTitle">机构名称：</div>
            <div class="listCont">{{ lineData.officeName }}</div>
          </div>
          <div class="lister">
            <div class="listTitle">机构类型：</div>
            <div class="listCont">
              <span v-if="lineData.officeType == 0">OEM</span>
              <span v-if="lineData.officeType == 1">普通代理</span>
              <span v-if="lineData.officeType == 2">admin</span>
              <span v-if="lineData.officeType == 3">渠道机构</span>
            </div>
          </div>
          <div class="lister">
            <div class="lister" style="margin-bottom: 0">
              <div class="listTitle">提现方式：</div>
              <div class="listCont">
                <span v-if="lineData.withdrawType == 0">线下提现</span>
                <span v-if="lineData.withdrawType == 1">海科代付</span>
                <span v-if="lineData.withdrawType == 2">厦门国际分账</span>
                <span v-if="lineData.withdrawType == 3">支付宝</span>
                <span v-if="lineData.withdrawType == 4">微信</span>
              </div>
            </div>
          </div>
          <div class="lister">
            <div class="listTitle">有无发票：</div>
            <div class="listCont">
              <span v-if="lineData.billFlag == 0">无</span>
              <span v-if="lineData.billFlag == 1">有</span>
            </div>
          </div>
          <div class="lister">
            <div class="listTitle">账户名称：</div>
            <div class="listCont">{{ lineData.accountName }}</div>
          </div>
          <div class="lister">
            <div class="listTitle">提现账号：</div>
            <div class="listCont">{{ lineData.accountNo }}</div>
          </div>
          <div class="lister">
            <div class="listTitle">开户行：</div>
            <div class="listCont">{{ lineData.bankName }}</div>
          </div>
          <div class="lister">
            <div class="listTitle">申请时间：</div>
            <div class="listCont">{{ lineData.startDate }}</div>
          </div>
          <div class="footerBot">
            <div class="lister">
              <div class="listTitle">申请金额：</div>
              <div class="listCont">{{ lineData.drawAmount }}元</div>
            </div>
            <div class="lister" style="margin-left: 20px">
              <div class="listTitle">提现手续费：</div>
              <div class="listCont">{{ lineData.feeAmt }}元</div>
            </div>
            <div class="lister" style="margin-left: 25px">
              <div class="listTitle">实际到账金额：</div>
              <div class="listCont">{{ lineData.arriveAmount }}元</div>
            </div>
          </div>
        </div>

        <div class="last">
          <div class="lister">
            <div class="listTitle">审核：</div>
            <div class="listCont">
              <div class="listContBox">
                <el-radio-group v-model="opinion.operateStatus">
                  <el-radio :label="'1'"> 审核通过</el-radio>
                  <el-radio :label="'2'"> 审核未通过</el-radio>
                </el-radio-group>
              </div>
            </div>
          </div>
        </div>
        <div class="lister">
          <div class="listTitle" style="padding-top: 4px">备注：</div>
          <div class="listCont">
            <el-input
              type="textarea"
              :rows="1"
              maxlength="20"
              style="width: 380px"
              placeholder="20个字符"
              v-model="opinion.remarks"
            >
            </el-input>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import ElRow from "element-ui/packages/row/src/row";
import https from "../../plugins/https.js";
import Tree from "../tree/index";
// 批量导出
import { exportFile } from "../../plugins/expord";
import axios from "axios";
export default {
  name: "shareTheTemplate",
  data() {
    return {
      type: "",
      loginName: "", //登录人
      // 提现审核弹框
      dialogVisible: false,
      // 选中的
      selectData: [],
      activeName: "1",
      list: [],
      title: "提现订单审核通过后,请登录支付宝账号进行转账",
      total: null,
      listLoading: true,
      checkedAll: false,
      showType: false,
      officeName: "",
      // 传递的审核意见
      opinion: {
        // 通过未通过
        operateStatus: "1",
        // 审核意见
        remarks: "",
        // 订单号列表
        orderCodeList: [],
      },
      listQuery: {
        startDate: "", //申请开始时间
        endDate: "", //申请结束时间
        auditStartDate: "", //审核开始时间
        auditEndDate: "", //审核结束时间
        toOfficeUid: "",
        oemUid: undefined, //OEMid
        officeUid: undefined, //	机构ID
        officeName: undefined, //	机构名称
        officeType: undefined, //	机构类型
        orderCode: undefined, //	订单号

        drawAmount: "", //申请提现金金额
        arriveAmount: "", //实际到账金额
        accountName: "", //账户名称
        accountNo: "", //提现账号
        billFlag: "", //是否有发票
        checkStat: "", //审核状态
        payStatus: "", //出款状态
        withdrawType: "", //提现类型

        channelOrderCode: undefined, //	渠道订单号
        withdrawAccountType: undefined, //	提现账户类型
        withdrawAccountNo: undefined, //	提现帐户号码
        AccountName: undefined, //	付款账户名
        AccountNo: undefined, //	付款账户号
        withdrawStartDate: undefined, //	提现开始时间
        withdraw: undefined, // EndDate	提现结束时间
        startDate: undefined, //	开始时间
        endDate: undefined, //	结束时间
        ifAudit: undefined,
        page: 1, //第几页
        number: 20, //每页几条
      },
      monthWithdraw: "0.00",
      nowDayWithdraw: "0.00",
      form: {},
      rules: {},
      // 提交审核的结果和意见
      data: {
        // 审核通过和未通过
        operateStatus: "",
        // 审核意见
        remarke: "",
      },
      // 点击审核存放当前列的数据
      lineData: "",
      dialogFormWithdrawList: false,
      // urltype: this.GLOBAL.httpurl, //请求地址

      selectTime: [],
      selectTimes: [],
      multipleSelection: [], //选中的数组
      sign: localStorage.getItem("jurisdiction") == 2, //最高权限看到的true
      statusList: [
        { label: "审核中", id: "0" },
        { label: "待出款", id: "1" },
        { label: "已出款", id: "2" },
        { label: "审核通过", id: "5" },
        {
          label: "审核失败",
          id: "3",
        },
      ],
      orgType: [
        { label: "是", id: "0" },
        { label: "否", id: "1" },
      ],
      officeType: [
        { label: "OEM代理", id: "0" },
        { label: "普通代理", id: "1" },
        { label: "渠道机构", id: "3" },
      ],
      withdrawType: [
        { label: "支付宝", id: "0" },
        { label: "公户", id: "1" },
        { label: "银行卡", id: "2" },
      ],
    };
  },
  components: {
    ElRow,
    Tree,
  },

  created() {
    // 判断是不是从首页跳转过来的
    if (this.$route.query.status) {
      this.listQuery.checkStat = "0";
    }

    let jurisdiction = localStorage.getItem("jurisdiction");
    if (jurisdiction == 2) {
      this.activeName = "1";
    } else {
      this.activeName = "2";
    }
    if (this.activeName == 2) {
      this.listQuery.toOfficeUid = undefined;
      this.listQuery.oemUid = localStorage.getItem("uid");
    } else if (this.activeName == 3) {
      this.listQuery.oemUid = undefined;
      this.listQuery.toOfficeUid = localStorage.getItem("uid");
    } else {
      this.listQuery.oemUid = undefined;
      this.listQuery.toOfficeUid = undefined;
    }
    this.loginName = localStorage.getItem("jurisdiction");
    let that = this;
    that.handleSelectList();
  },

  methods: {
    //
    handleClose() {
      this.dialogVisible = false;
    },

    // tab切换
    handleClick(val) {
      this.resetTheSearch();
      console.log(val.name);
      let name = val.name;
      // console.log(this.activeName);
      let jurisdiction = localStorage.getItem("jurisdiction");
      // console.log(val)
      if (jurisdiction == 2) {
        this.activeName = "1";
      } else {
        this.activeName = "2";
      }
      if (name == 2) {
        this.listQuery.toOfficeUid = undefined;
        this.listQuery.oemUid = localStorage.getItem("uid");
      } else {
        this.listQuery.oemUid = undefined;
        this.listQuery.toOfficeUid = localStorage.getItem("uid");
      }
      this.handleSelectList();
    },

    // 提交审核
    submit() {
      console.log(this.opinion);
      if (this.opinion.remarks == "") {
        layer.open({
          content: "输入不能为空",
          skin: "msg",
          time: 1, //1秒后自动关闭
        });

        return;
      }

      axios
        .post("/api/account/newAuditWithdraw", this.opinion)
        .then((res) => {
          console.log("审核");
          console.log(res);
          if (res.data.code == "0000") {
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 1, //1秒后自动关闭
            });
            this.dialogVisible = false;
            this.remarke = this.opinion.operateStatus = "";
            this.opinion.remarks = "";
            this.opinion.orderCodeList = "";
            this.handleSelectList();
          } else {
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 1, //1秒后自动关闭
            });
          }
        })
        .catch((err) => {
          console.log(err);
        });
      return;
      https
        .auditWithdraw({
          id: this.lineData.id,
          operateStatus: this.data.operateStatus,
          remarke: this.data.remarke,
          orderCode: this.lineData.orderCode,
        })
        .then((res) => {
          if (res.data.code == "0000") {
            that.dialogFormWithdrawList = false;
            // debugger
            if (that.form.withdrawAccountType != 2) {
              layer.open({
                content: res.data.msg,
                skin: "msg",
                time: 2, //1秒后自动关闭
              });
            } else {
              if (that.form.operateStatus == 1) {
                window.open(res.data.data.retUrl);
              } else {
                layer.open({
                  content: res.data.msg,
                  skin: "msg",
                  time: 2, //1秒后自动关闭
                });
              }
            }
          } else {
            layer.open({
              content: res.data.msg,
              skin: "msg",
              time: 2, //1秒后自动关闭
            });
          }
          that.handleSelectList();
        })
        .catch((e) => {});
    },
    // 获取选中表格的第几行
    handleSelectionChange(val) {
      console.log(val);
      this.selectData = val;
    },
    // 审核弹框
    examine(val) {
      console.log(val);
      this.opinion.orderCodeList = [];
      this.opinion.orderCodeList.push(val.orderCode);
      this.lineData = val;
      this.type = "";
      this.opinion.remarks = "";
      this.dialogVisible = true;
    },
    // 批量审核
    shen() {
      this.type = "0001";
      this.dialogVisible = true;
      this.opinion.orderCodeList = [];
      for (let i = 0; i < this.selectData.length; i++) {
        this.opinion.orderCodeList.push(this.selectData[i].orderCode);
      }
    },

    //这里开始
    transmit(data) {
      console.log(data.uid);
      //归属机构的uid
      this.listQuery.officeUid = data.uid;
      this.officeName = data.name;
    },
    //设置取消的
    determine() {
      // alert("执行")
      this.showType = false;
    },

    selectInstitution() {
      this.showType = true;
    },
    //这里结束

    /**
     * @Author： Zhu Liang Fu
     * @Date：2020/7/15
     * @annotation: 全选
     **/
    selAll() {
      if (this.checkedAll) {
        this.list.forEach((row) => {
          this.$refs.multipleTable.toggleRowSelection(row);
        });
      } else {
        this.$refs.multipleTable.clearSelection();
      }
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 16:41
     * @annotation： 界面集合获取数据
     **/
    handleSelectList() {
      let that = this;
      that.listLoading = true;
      https.queryWithdrawList(that.listQuery).then((res) => {
        if (res.data.code == "0000") {
          that.monthWithdraw = res.data.monthWithdraw;
          that.nowDayWithdraw = res.data.nowDayWithdraw;
          that.list = res.data.data;
          that.total = res.data.total;
          that.listLoading = false;
        } else {
          that.listLoading = false;
          layer.open({
            content: res.data.msg,
            skin: "msg",
            time: 2, //1秒后自动关闭
          });
        }
      });
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:57
     * @annotation： 分页
     **/
    handleSizeChange(val) {
      let that = this;
      that.listQuery.number = val;
      that.listQuery.page = 1;
      that.handleSelectList();
    },
    handleSelectLists() {
      let that = this;
      that.listQuery.page = 1;
      that.handleSelectList();
    },
    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:57
     * @annotation： 分页
     **/
    handleCurrentChange(val) {
      let that = this;
      that.listQuery.page = val;
      that.handleSelectList();
    },

    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 16:41
     * @annotation：  时间格式化
     **/
    timeData(e) {
      let that = this;
      if (e) {
        that.listQuery.withdrawStartDate = e[0];
        that.listQuery.withdrawEndDate = e[1];
      } else {
        that.listQuery.withdrawStartDate = undefined;
        that.listQuery.withdrawEndDate = undefined;
      }
    },
    timeDatas(e) {
      let that = this;
      if (e) {
        that.listQuery.startDate = e[0];
        that.listQuery.endDate = e[1];
      } else {
        that.listQuery.startDate = undefined;
        that.listQuery.endDate = undefined;
      }
    },

    /**
     * @Author: Zhu Liang Fu
     * @Date: 2020/7/14 10:11
     * @Description:查看弹框
     */
    examineData(row) {
      console.log(row);
      let that = this;
      if (row.withdrawAccountType == 0)
        this.title = "审核通过后，请登录支付宝账户进行支付";
      else this.title = "审核通过后，跳转厦门国际银进行支付";

      that.form = row;
      console.log(row);
      that.form.status = String(row.status);
      that.form.statusCk = row.status;
      that.dialogFormWithdrawList = true;
    },

    /**
     * @author: Zhu Liangfu
     * @Description: 导出模板
     * @date:2020/6/11   20:44
     */
    exportFiles() {
      let that = this;
      exportFile(
        "/api/account/withdraw/excel/export",
        that.listQuery,
        "提现明细"
      );
    },

    /**
     * @author: Zhu Liangfu
     * @Description: 审核
     * @date:2020/7/14   21:11
     */
    upData(row) {
      let that = this;
      console.log(row);
      //
      if (that.form.status == 0) {
        https
          .auditWithdraw({
            id: that.form.id,
            operateStatus: that.form.operateStatus,
            remarke: that.form.remarke,
            orderCode: that.form.orderCode,
          })
          .then((res) => {
            if (res.data.code == "0000") {
              that.dialogFormWithdrawList = false;
              // debugger
              if (that.form.withdrawAccountType != 2) {
                layer.open({
                  content: res.data.msg,
                  skin: "msg",
                  time: 2, //1秒后自动关闭
                });
              } else {
                if (that.form.operateStatus == 1) {
                  window.open(res.data.data.retUrl);
                } else {
                  layer.open({
                    content: res.data.msg,
                    skin: "msg",
                    time: 2, //1秒后自动关闭
                  });
                }
              }
            } else {
              layer.open({
                content: res.data.msg,
                skin: "msg",
                time: 2, //1秒后自动关闭
              });
            }
            that.handleSelectList();
          })
          .catch((e) => {});
      } else {
        that.dialogFormWithdrawList = false;
      }
    },

    /**
     * @Author： Zhu Liang Fu
     * @Date： 2020/6/10 17:50
     * @annotation： 重置查询条件
     **/
    resetTheSearch() {
      let that = this;
      this.officeName = "";
      this.listQuery.startDate = "";
      this.listQuery.endDate = "";
      this.listQuery.auditStartDate = "";
      this.listQuery.auditEndDate = "";
      this.listQuery.officeUid = "";
      this.listQuery.officeName = "";
      this.listQuery.officeType = "";
      this.listQuery.orderCode = "";
      this.listQuery.channelOrderCode = "";
      this.listQuery.withdrawAccountType = "";
      this.listQuery.withdrawAccountNo = "";
      this.listQuery.AccountName = "";
      this.listQuery.AccountNo = "";
      this.listQuery.withdrawStartDate = "";
      this.listQuery.withdraw == "";
      this.listQuery.withdraw = "";
      this.listQuery.withdrawType = "";

      this.listQuery.drawAmount = ""; //申请提现金金额
      this.listQuery.arriveAmount = ""; //实际到账金额
      this.listQuery.accountName = ""; //账户名称
      this.listQuery.accountNo = ""; //提现账号
      this.listQuery.billFlag = ""; //是否有发票
      this.listQuery.checkStat = ""; //审核状态
      this.listQuery.payStatus = ""; //出款状态

      this.listQuery.page = 1;
      // that.listQuery = {
      //   oemUid:
      //     localStorage.getItem("jurisdiction") != 2
      //       ? localStorage.getItem("uid")
      //       : undefined, //OEMid
      //   officeUid: undefined, //	机构ID
      //   officeName: undefined, //	机构名称
      //   officeType: undefined, //	机构类型
      //   orderCode: undefined, //	订单号
      //   channelOrderCode: undefined, //	渠道订单号
      //   withdrawAccountType: undefined, //	提现账户类型
      //   withdrawAccountNo: undefined, //	提现帐户号码
      //   AccountName: undefined, //	付款账户名
      //   AccountNo: undefined, //	付款账户号
      //   withdrawStartDate: undefined, //	提现开始时间
      //   withdraw: undefined, // EndDate	提现结束时间
      //   startDate: undefined, //	开始时间
      //   endDate: undefined, //	结束时间
      //   ifAudit: undefined,
      //   number:20,
      //   page: 1, //第几页
      // };
      that.selectTime = [];
      that.selectTimes = [];
      that.handleSelectList();
    },
  },
};
</script>

<style scoped>
.line > span {
  margin-left: 20px;
  width: 330px;
}
.con {
  position: relative;
}
/* 单独样式 */
.contbox6_10 {
  width: 100%;
  /*  height: 87.5vh; */
  overflow-x: auto;
  box-sizing: border-box;
  float: left;
}

.fileList {
  display: inline-block;
  border-style: solid dotted dashed double;
  padding: 8px 8px 8px 8px;
  text-align: center;
}
.times {
  width: 20px;
  display: inline-block;
  text-align: center;
}
.el-col-24 > .el-form-item {
  width: 100%;
}
.boxer {
  /* padding-right: 10px; */
  /* float: right; */
}
.buttons > .el-button {
  width: 100px;
  height: 32px;
  float: left;
}
/* .el-radio{
  margin-right: 0
} */
.el-col-20 {
  width: 100%;
}
/deep/ .el-radio__label {
  padding-left: 0px !important;
}
.lister {
  display: flex;
  margin-bottom: 10px;
}
.listTitle {
  width: 110px;
  text-align: right;
}
.footerBot {
  display: flex;
}
.listContBox {
  display: flex;
  height: 100%;
  align-items: center;
}
.footerBot div {
  color: #f56c6c;
}
.tabBox {
  transform: translateY(-20px);
  box-sizing: border-box;
  position: absolute;
  width: 100%;
  z-index: 9;
}
/deep/ .el-tabs__header {
  background: white;
  padding-left: 20px;
}
</style>
